package com.xflib.tool.builder;

import org.slf4j.LoggerFactory;

public class PnpmBuilder extends NpmBuilder{

    public PnpmBuilder(BuilderFactory builderFactory) {
        super(builderFactory);
        super.setLogger(LoggerFactory.getLogger(this.getClass()));
    }

    @Override
    public String getId() {
        return "pnpm";
    }

    @Override
    public String getDescribe() {
        return "PNPM builder.";
    }

    @Override
    protected String getCommandBuild(BuilderProjectProperties properties) {
        String profile=properties.getProfile();
        if(null==profile || profile.trim().isEmpty()){
            profile = "";
        }else{
            profile=":".concat(profile);
        }
        return "pnpm i & pnpm run build".concat(profile);
    }

}
